#include<iostream>
#include<string>
#include<map>
using namespace std;
typedef long long LL;
const int N = 1e6 + 10;
map<LL, int>mp;
int n, m;
LL a[N];
int main()
{
	int ans = 0;
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		a[i] += a[i - 1];
		mp[a[i]] = 1;
	}
	for (int i = 1; i <= n; i++) {
		if (mp[a[i] - m])ans++;
	}
	cout << ans << endl;
	return 0;
}